Optimal. Leaf size=87 \[ -\frac{\left (a^2 d+2 a b c-b^2 d\right ) \log (\cos (e+f x))}{f}+x \left (a^2 c-2 a b d-b^2 c\right )+\frac{b (a d+b c) \tan (e+f x)}{f}+\frac{d (a+b \tan (e+f x))^2}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0798564, antiderivative size = 87, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3528, 3525, 3475} \[ -\frac{\left (a^2 d+2 a b c-b^2 d\right ) \log (\cos (e+f x))}{f}+x \left (a^2 c-2 a b d-b^2 c\right )+\frac{b (a d+b c) \tan (e+f x)}{f}+\frac{d (a+b \tan (e+f x))^2}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3528
Rule 3525
Rule 3475
Rubi steps
\begin{align*} \int (a+b \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx &=\frac{d (a+b \tan (e+f x))^2}{2 f}+\int (a+b \tan (e+f x)) (a c-b d+(b c+a d) \tan (e+f x)) \, dx\\ &=\left (a^2 c-b^2 c-2 a b d\right ) x+\frac{b (b c+a d) \tan (e+f x)}{f}+\frac{d (a+b \tan (e+f x))^2}{2 f}+\left (2 a b c+a^2 d-b^2 d\right ) \int \tan (e+f x) \, dx\\ &=\left (a^2 c-b^2 c-2 a b d\right ) x-\frac{\left (2 a b c+a^2 d-b^2 d\right ) \log (\cos (e+f x))}{f}+\frac{b (b c+a d) \tan (e+f x)}{f}+\frac{d (a+b \tan (e+f x))^2}{2 f}\\ \end{align*}
Mathematica [C] time = 0.44539, size = 96, normalized size = 1.1 \[ \frac{2 b (2 a d+b c) \tan (e+f x)+(a-i b)^2 (d+i c) \log (\tan (e+f x)+i)+(a+i b)^2 (d-i c) \log (-\tan (e+f x)+i)+b^2 d \tan ^2(e+f x)}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.005, size = 151, normalized size = 1.7 \begin{align*}{\frac{{b}^{2}d \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,f}}+2\,{\frac{abd\tan \left ( fx+e \right ) }{f}}+{\frac{{b}^{2}c\tan \left ( fx+e \right ) }{f}}+{\frac{{a}^{2}\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) d}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) abc}{f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){b}^{2}d}{2\,f}}+{\frac{{a}^{2}\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f}}-2\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) abd}{f}}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ){b}^{2}c}{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.77721, size = 124, normalized size = 1.43 \begin{align*} \frac{b^{2} d \tan \left (f x + e\right )^{2} - 2 \,{\left (2 \, a b d -{\left (a^{2} - b^{2}\right )} c\right )}{\left (f x + e\right )} +{\left (2 \, a b c +{\left (a^{2} - b^{2}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \,{\left (b^{2} c + 2 \, a b d\right )} \tan \left (f x + e\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.47966, size = 209, normalized size = 2.4 \begin{align*} \frac{b^{2} d \tan \left (f x + e\right )^{2} - 2 \,{\left (2 \, a b d -{\left (a^{2} - b^{2}\right )} c\right )} f x -{\left (2 \, a b c +{\left (a^{2} - b^{2}\right )} d\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 2 \,{\left (b^{2} c + 2 \, a b d\right )} \tan \left (f x + e\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.377592, size = 143, normalized size = 1.64 \begin{align*} \begin{cases} a^{2} c x + \frac{a^{2} d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{a b c \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} - 2 a b d x + \frac{2 a b d \tan{\left (e + f x \right )}}{f} - b^{2} c x + \frac{b^{2} c \tan{\left (e + f x \right )}}{f} - \frac{b^{2} d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{b^{2} d \tan ^{2}{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (a + b \tan{\left (e \right )}\right )^{2} \left (c + d \tan{\left (e \right )}\right ) & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.83952, size = 1307, normalized size = 15.02 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]